
import {get_user_list, search_list} from "../../api/api"

const user={
    namespaced:true,
    state:{
        userList:[]
    },
    mutations: {
        set_user_list(state,payload){
            state.userList=payload
        }
    },
    actions: {
        // 获取数据
        async get_list_action({commit}){
            const {data}=await get_user_list()
            commit("set_user_list",data.result)
        },
        // 搜索
        async get_search_list({commit},payload){
            const {data}=await search_list(payload)
            commit("set_user_list",data.result)
        }
    }
}

export default user